package org.example;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;

import static org.example.MySubscribableChannel.INPUT1;
import static org.example.MySubscribableChannel.INPUT2;

/**
 * @Author: tang
 * @Description:
 * @Date 2024/5/27 16:53
 */
@EnableBinding({Sink.class,MySubscribableChannel.class})
public class RecieveService {

    @StreamListener(Sink.INPUT)
    public void recieve(Object payload){
        System.out.println(payload);
    }

    @StreamListener(INPUT1)
    public void subChannel (String msg){
        System.out.println(msg);
    }

    @StreamListener(INPUT2)
    public void subChannel2 (String msg){
        System.out.println(msg);
    }
}
